package com.seecoder.BlueWhale.vo;

import com.seecoder.BlueWhale.po.Comment;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

import java.util.Date;

@Setter
@Getter
@NoArgsConstructor
@AllArgsConstructor
public class CommentVO {
    private Integer id;                 //评论id
    private Integer orderID;            //订单编号
    private Integer userID;             //评论者id
    private String userName;            //评论者名字
    private Integer commodityID;        //评论的商品id
    private Date createTime;            //创建时间
    private String commentContent;      //评论的内容
    private float rating;               //评分

    public Comment toPO() {
        Comment comment = new Comment();
        comment.setId(this.id);
        comment.setOrderID(this.orderID);
        comment.setUserID(this.userID);
        comment.setUserName(this.userName);
        comment.setCommodityID(this.commodityID);
        comment.setCreateTime(this.createTime);
        comment.setCommentContent(commentContent);
        comment.setRating(this.rating);
        return comment;
    }
}
